# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor: William Rea <sillywilly@gmail.com>

_origname=reportlab
pkgname=python-reportlab
pkgver=3.6.12
pkgrel=3
pkgdesc="A proven industry-strength PDF generating solution"
arch=('loong64' 'x86_64')
url="https://www.reportlab.com/"
depends=('freetype2')
depends=('python' 'python-pillow')
makedepends=('freetype2' 'python-pillow' 'mercurial')
license=('BSD')
source=(https://files.pythonhosted.org/packages/source/${_origname::1}/${_origname}/${_origname}-${pkgver}.tar.gz)
sha256sums=('b13cebf4e397bba14542bcd023338b6ff2c151a3a12aabca89eecbf972cb361a')

build() {
    cd ${_origname}-${pkgver}
    python setup.py build
}

check() {
    cd ${_origname}-${pkgver}
    python -m unittest discover -vs tests || true
    rm tests/_i_am_actually_a_*
}

package() {
    cd ${_origname}-${pkgver}
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build
    install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/license.txt
}
